const express = require('express')
const router = express.Router()

const toJson = (data) => {
    return JSON.stringify(data)
}

// router.get('/system/dict/data/type/sys_show_hide', (req, res) => {
//     const body = {
//         "msg": "操作成功",
//         "code": 200,
//         "token": "1234567890"
//     }
//     res.send(toJson(body))
// })
router.get('/system/dept/list', (req, res) => {
    const body = {
        "msg": "操作成功",
        "code": 200,
        "data": [
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:07",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 100,
                "parentId": 0,
                "ancestors": "0",
                "deptName": "总公司",
                "orderNum": 0,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:07",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 101,
                "parentId": 100,
                "ancestors": "0,100",
                "deptName": "深圳总公司",
                "orderNum": 1,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:07",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 102,
                "parentId": 100,
                "ancestors": "0,100",
                "deptName": "长沙分公司",
                "orderNum": 2,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:08",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 103,
                "parentId": 101,
                "ancestors": "0,100,101",
                "deptName": "研发部门",
                "orderNum": 1,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:08",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 104,
                "parentId": 101,
                "ancestors": "0,100,101",
                "deptName": "市场部门",
                "orderNum": 2,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:08",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 105,
                "parentId": 101,
                "ancestors": "0,100,101",
                "deptName": "测试部门",
                "orderNum": 3,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:08",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 106,
                "parentId": 101,
                "ancestors": "0,100,101",
                "deptName": "财务部门",
                "orderNum": 4,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:09",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 107,
                "parentId": 101,
                "ancestors": "0,100,101",
                "deptName": "运维部门",
                "orderNum": 5,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:09",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 108,
                "parentId": 102,
                "ancestors": "0,100,102",
                "deptName": "市场部门",
                "orderNum": 1,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:27:09",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "deptId": 109,
                "parentId": 102,
                "ancestors": "0,100,102",
                "deptName": "财务部门",
                "orderNum": 2,
                "leader": "领导",
                "phone": "15888888888",
                "email": "ry@qq.com",
                "status": "0",
                "delFlag": "0",
                "parentName": null,
                "children": []
            }
        ]
    }
    res.send(toJson(body))
})
router.get('/system/dict/data/type/sys_normal_disable', (req, res) => {
    const body = {
        "msg": "操作成功",
        "code": 200,
        "data": [
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:28:21",
                "updateBy": null,
                "updateTime": null,
                "remark": "正常状态",
                "dictCode": 6,
                "dictSort": 1,
                "dictLabel": "正常",
                "dictValue": "0",
                "dictType": "sys_normal_disable",
                "cssClass": "",
                "listClass": "primary",
                "isDefault": "Y",
                "status": "0",
                "default": true
            },
            {
                "createBy": "admin",
                "createTime": "2024-06-30 11:28:21",
                "updateBy": null,
                "updateTime": null,
                "remark": "停用状态",
                "dictCode": 7,
                "dictSort": 2,
                "dictLabel": "停用",
                "dictValue": "1",
                "dictType": "sys_normal_disable",
                "cssClass": "",
                "listClass": "danger",
                "isDefault": "N",
                "status": "0",
                "default": false
            }
        ]
    }
    res.send(toJson(body))
})


module.exports = router